﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="TracNghiem_1L.ascx.cs"
    Inherits="TracNghiem_1L" %>
<%@ Import Namespace="TaiLieu" %>
<script language="javascript" type="text/javascript">
    function confirmFeedBack(id, name) {
        if (confirm("Bạn chắc chắn với quyết định của mình chưa ?")) {
            window.location = "<%=_Url%>" + id;

        }
        else {
            window.location = "<%=_Url%>" + 0;
        }
    }
    function check_Click(id, id1234) {

        var id1 = "A" + id; var id2 = "B" + id; var id3 = "C" + id; var id4 = "D" + id;
        switch (id1234) {
            case id1:
                document.getElementById(id1).checked = true;
                document.getElementById(id2).checked = false;
                document.getElementById(id3).checked = false;
                document.getElementById(id4).checked = false;
                break;
            case id2:
                document.getElementById(id1).checked = false;
                document.getElementById(id2).checked = true;
                document.getElementById(id3).checked = false;
                document.getElementById(id4).checked = false;

                break;
            case id3:
                document.getElementById(id1).checked = false;
                document.getElementById(id2).checked = false;
                document.getElementById(id3).checked = true;
                document.getElementById(id4).checked = false;

                break;
            case id4:
                document.getElementById(id1).checked = false;
                document.getElementById(id2).checked = false;
                document.getElementById(id3).checked = false;
                document.getElementById(id4).checked = true;

                break;
        }



    }
</script>
<table id="Table2" cellspacing="1" cellpadding="1">
    <tr>
        <td class="toolbar">
            <b>
                <%=this._link %>
            </b>
        </td>
    </tr>
    <tr style="text-align: left">
        <td align="center" colspan="4" style="width: 908px">
            <asp:Label ID="labMessage" runat="server" Width="100%" ForeColor="Red" Font-Bold="True"></asp:Label>
        </td>
    </tr>
    <%--<tr>
        <td align="left">
            <asp:GridView ID="GridView1" runat="server">
            </asp:GridView>
        </td>
    </tr>--%>
    <tr>
        <td align="left">
            <asp:GridView runat="server" ShowHeader="true" ID="grid" BorderWidth="1px" RowStyle-BorderStyle="None"
                Width="100%" AllowPaging="True" PageSize="20">
                <Columns>
                    <asp:TemplateField HeaderText="Câu hỏi" HeaderStyle-Width="200px">
                        <ItemTemplate>
                            <asp:TextBox runat="server" ReadOnly="true" ID="txtquestion" Text=' <%#Eval("TracNghiem.question")%>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ReadOnly="true" ID="txtquestion" Text=' <%#Eval("TracNghiem.question")%>' />
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                      <asp:TemplateField>
                        <ItemTemplate>
                            <input type="checkbox" onselect="" id="A<%#Eval(ColumTracNghiem.Id)%>" name="A<%#Eval(ColumTracNghiem.Id)%>"
                                value="1" onclick="check_Click(<%#Eval(ColumTracNghiem.Id)%>,'A<%#Eval(ColumTracNghiem.Id)%>')">
                            <%#Eval(ColumTracNghiem.answer1)%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ID="txtanswer1" Text=' <%#Eval(ColumTracNghiem.answer1)%>' />
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <input type="checkbox" onselect="" id="B<%#Eval(ColumTracNghiem.Id)%>" name="B<%#Eval(ColumTracNghiem.Id)%>"
                                value="1" onclick="check_Click(<%#Eval(ColumTracNghiem.Id)%>,'B<%#Eval(ColumTracNghiem.Id)%>')">
                            <%#Eval(ColumTracNghiem.answer2)%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ID="txtanswer2" Text='<%#Eval(ColumTracNghiem.answer2)%>' />
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                  <asp:TemplateField>
                        <ItemTemplate>
                            <input type="checkbox" id="C<%#Eval(ColumTracNghiem.Id)%>" name="C<%#Eval(ColumTracNghiem.Id)%>" 
                                value="3" onclick="check_Click(<%#Eval(ColumTracNghiem.Id)%>,'C<%#Eval(ColumTracNghiem.Id)%>')">
                            <%#Eval(ColumTracNghiem.answer3)%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ID="txtanswer3" Text=' <%#Eval(ColumTracNghiem.answer3)%>' />
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                             <input type="checkbox" id="D<%#Eval(ColumTracNghiem.Id)%>" name="D<%#Eval(ColumTracNghiem.Id)%>"
                                value="4" onclick="check_Click(<%#Eval(ColumTracNghiem.Id)%>,'D<%#Eval(ColumTracNghiem.Id)%>')">
                            <%#Eval("TracNghiem.answer4")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <%-- <asp:TextBox runat="server" ID="txtanswer4" Text=' <%#Eval("TracNghiem.answer1")%>' />--%>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                     <asp:TemplateField HeaderText="Kích hoạt">
                        <ItemTemplate>
                            <%#Eval(ColumTracNghiem.Active)%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="ddLAct" runat="server">
                                <asp:ListItem>true</asp:ListItem>
                                <asp:ListItem>false</asp:ListItem>
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                </Columns>
                <RowStyle BorderStyle="None" BorderWidth="0px" />
                <HeaderStyle BackColor="#F1F1F1" />
                <AlternatingRowStyle BackColor="#F8F8F8" BorderColor="#F8F8F8" />
            </asp:GridView>
        </td>
    </tr>
</table>
